package org.creavi.engine.hud.builder;

import org.creavi.engine.hud.GaugeHudInstance;
import org.creavi.engine.hud.GaugeType;
import org.creavi.engine.hud.HudDefinition;

public class GaugeBuilder extends HudInstanceBuilder {

	private GaugeType type;
	private boolean stretch;

	public GaugeBuilder() {
		this.type = GaugeType.Left;
		this.stretch = true;
	}

	@Override
	public void createNewHudInstance(String name, HudDefinition hudDefinition) {
		this.hudInstance = new GaugeHudInstance(name, hudDefinition);
	}

	@Override
	public void enhanceHud(HudDefinition hudDefinition) {
		GaugeHudInstance hud = (GaugeHudInstance) hudInstance;
		hud.setType(type);
		hud.setStretch(stretch);
		hud.setMin(0);
		hud.setMax(100);
		hud.setValue(100);
	}

	public GaugeType getType() {
		return type;
	}

	public void setType(GaugeType type) {
		this.type = type;
	}

	public boolean isStretch() {
		return stretch;
	}

	public void setStretch(boolean stretch) {
		this.stretch = stretch;
	}

}
